#include "GCylinder.h"


namespace GMath
{
	GCylinder::GCylinder()
	{
		Radius = 1.0f;
		Height = 1.0f;
		Center = GVector3::Zero;
		Up = GVector3::UnitY;
	}

	GCylinder::GCylinder(float TheRadius, float TheHeight, const GVector3& TheCenter, const GVector3& TheUp)
	{
		Create(TheRadius, TheHeight, TheCenter, TheUp);
	}

	GCylinder::~GCylinder()
	{
	}

	void GCylinder::Create(float TheRadius, float TheHeight, const GVector3& TheCenter, const GVector3& TheUp)
	{
		Radius = TheRadius;
		Height = TheHeight;
		Center = TheCenter;
		Up = TheUp;
	}

	float GCylinder::GetArea() const
	{
		return G_PI_TIME_2 * Radius * (Height + Radius);
	}

	float GCylinder::GetVolume() const
	{
		return G_PI * Radius * Radius * Height;
	}

}